
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <title>7.配置详解 · MPUSH开发文档</title>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.0">
        <meta name="author" content="夜色">
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-prism/prism.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-navigator/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="chapter17.html" />
    
    
    <link rel="prev" href="chapter13.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    0.Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="chapter1.html">
            
                <a href="chapter1.html">
            
                    
                    1.系统架构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="chapter2.html">
            
                <a href="chapter2.html">
            
                    
                    2.服务依赖关系
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="chapter3.html">
            
                <a href="chapter3.html">
            
                    
                    3.协议
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="chapter4.html">
            
                <a href="chapter4.html">
            
                    
                    4.主要流程
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="chapter6.html">
            
                <a href="chapter6.html">
            
                    
                    4.1.密钥交换方案
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="chapter7.html">
            
                <a href="chapter7.html">
            
                    
                    4.2.握手及快速重连
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="chapter8.html">
            
                <a href="chapter8.html">
            
                    
                    4.3.绑定用户及路由发布
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="chapter9.html">
            
                <a href="chapter9.html">
            
                    
                    4.4.解绑用户
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="chapter10.html">
            
                <a href="chapter10.html">
            
                    
                    4.5.消息推送
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="chapter11.html">
            
                <a href="chapter11.html">
            
                    
                    4.6.Http代理
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="chapter12.html">
            
                <a href="chapter12.html">
            
                    
                    5.服务部署
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="chapter13.html">
            
                <a href="chapter13.html">
            
                    
                    6.源码测试
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.8" data-path="chapter14.html">
            
                <a href="chapter14.html">
            
                    
                    7.配置详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="chapter17.html">
            
                <a href="chapter17.html">
            
                    
                    8.Alloc实现
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="chapter15.html">
            
                <a href="chapter15.html">
            
                    
                    9.Android SDK
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="chapter15.1.html">
            
                <a href="chapter15.1.html">
            
                    
                    9.1.SDK系统架构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="chapter15.2.html">
            
                <a href="chapter15.2.html">
            
                    
                    9.2.MpushClient架构
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="chapter16.md">
            
                <span>
            
                    
                    10.IOS SDK
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="chapter18.html">
            
                <a href="chapter18.html">
            
                    
                    11.服务端SDK
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="chapter19.html">
            
                <a href="chapter19.html">
            
                    
                    12.HTTP代理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="chapter20.html">
            
                <a href="chapter20.html">
            
                    
                    13.Server源码分析
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.14.1" data-path="chapter20.1.html">
            
                <a href="chapter20.1.html">
            
                    
                    13.1.模块依赖关系
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="chapter21.html">
            
                <a href="chapter21.html">
            
                    
                    14.SPI定制化
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >7.配置详解</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x914D;&#x7F6E;&#x8BE6;&#x89E3;">&#x914D;&#x7F6E;&#x8BE6;&#x89E3;</h1><pre><code class="lang-java">##################################################################################################################
#
# NOTICE&#xFF1A;
#
# &#x7CFB;&#x7EDF;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#xFF0C;&#x6240;&#x6709;&#x5217;&#x51FA;&#x7684;&#x9879;&#x662F;&#x7CFB;&#x7EDF;&#x6240;&#x652F;&#x6301;&#x5168;&#x90E8;&#x914D;&#x7F6E;&#x9879;
# &#x5982;&#x679C;&#x8981;&#x8986;&#x76D6;&#x67D0;&#x9879;&#x7684;&#x503C;&#x53EF;&#x4EE5;&#x6DFB;&#x52A0;&#x5230;mpush<span class="token punctuation">.</span>conf&#x4E2D;&#x3002;
#
# &#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x683C;&#x5F0F;&#x91C7;&#x7528;HOCON&#x683C;&#x5F0F;&#x3002;&#x89E3;&#x6790;&#x5E93;&#x7531;https<span class="token operator">:</span><span class="token operator">/</span><span class="token operator">/</span>github<span class="token punctuation">.</span>com<span class="token operator">/</span>typesafehub<span class="token operator">/</span>config&#x63D0;&#x4F9B;&#x3002;
# &#x5177;&#x4F53;&#x53EF;&#x53C2;&#x7167;&#x5668;&#x8BF4;&#x660E;&#x6587;&#x6863;&#xFF0C;&#x6BD4;&#x5982;&#x542B;&#x6709;&#x7279;&#x6B8A;&#x5B57;&#x7B26;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#x5FC5;&#x987B;&#x7528;&#x53CC;&#x5F15;&#x53F7;&#x5305;&#x8D77;&#x6765;&#x3002;
#
##############################################################################################################

mp <span class="token punctuation">{</span>
    #&#x65E5;&#x5FD7;&#x914D;&#x7F6E;
    log<span class="token punctuation">.</span>level<span class="token operator">=</span>warn <span class="token comment" spellcheck="true">//&#x65E5;&#x5FD7;&#x7EA7;&#x522B;</span>
    log<span class="token punctuation">.</span>dir<span class="token operator">=</span>$<span class="token punctuation">{</span>user<span class="token punctuation">.</span>dir<span class="token punctuation">}</span><span class="token operator">/</span><span class="token punctuation">.</span><span class="token punctuation">.</span>/logs <span class="token comment" spellcheck="true">//&#x65E5;&#x5FD7;&#x76EE;&#x5F55;&#xFF0C;&#x72EC;&#x7ACB;&#x90E8;&#x7F72;&#x65F6;&#x4E0D;&#x5EFA;&#x8BAE;&#x66F4;&#x6539;</span>

    #&#x6838;&#x5FC3;&#x914D;&#x7F6E;
    core <span class="token punctuation">{</span>
        max<span class="token operator">-</span>packet<span class="token operator">-</span>size<span class="token operator">=</span>10k <span class="token comment" spellcheck="true">//&#x7CFB;&#x7EDF;&#x5141;&#x8BB8;&#x4F20;&#x8F93;&#x7684;&#x6700;&#x5927;&#x5305;&#x7684;&#x5927;&#x5C0F;</span>
        compress<span class="token operator">-</span>threshold<span class="token operator">=</span>10k <span class="token comment" spellcheck="true">//&#x6570;&#x636E;&#x5305;&#x542F;&#x7528;&#x538B;&#x7F29;&#x7684;&#x4E34;&#x754C;&#x503C;&#xFF0C;&#x8D85;&#x8FC7;&#x8BE5;&#x503C;&#x540E;&#x5BF9;&#x6570;&#x636E;&#x8FDB;&#x884C;&#x538B;&#x7F29;</span>
        min<span class="token operator">-</span>heartbeat<span class="token operator">=</span>3m <span class="token comment" spellcheck="true">//&#x6700;&#x5C0F;&#x5FC3;&#x8DF3;&#x95F4;&#x9694;</span>
        max<span class="token operator">-</span>heartbeat<span class="token operator">=</span>3m <span class="token comment" spellcheck="true">//&#x6700;&#x5927;&#x5FC3;&#x8DF3;&#x95F4;&#x9694;</span>
        max<span class="token operator">-</span>hb<span class="token operator">-</span>timeout<span class="token operator">-</span>times<span class="token operator">=</span><span class="token number">2</span> <span class="token comment" spellcheck="true">//&#x5141;&#x8BB8;&#x7684;&#x5FC3;&#x8DF3;&#x8FDE;&#x7EED;&#x8D85;&#x65F6;&#x7684;&#x6700;&#x5927;&#x6B21;&#x6570;</span>
        session<span class="token operator">-</span>expired<span class="token operator">-</span>time<span class="token operator">=</span><span class="token number">1d</span> <span class="token comment" spellcheck="true">//&#x7528;&#x4E8E;&#x5FEB;&#x901F;&#x91CD;&#x8FDE;&#x7684;session &#x8FC7;&#x671F;&#x65F6;&#x95F4;&#x9ED8;&#x8BA4;1&#x5929;</span>
        epoll<span class="token operator">-</span>provider<span class="token operator">=</span>netty <span class="token comment" spellcheck="true">//nio:jdk&#x81EA;&#x5E26;&#xFF0C;netty:&#x7531;netty&#x5B9E;&#x73B0;</span>
    <span class="token punctuation">}</span>

    #&#x5B89;&#x5168;&#x914D;&#x7F6E;
    security <span class="token punctuation">{</span>
        #rsa &#x79C1;&#x94A5;<span class="token punctuation">,</span> &#x516C;&#x94A5; key&#x957F;&#x5EA6;&#x4E3A;<span class="token number">1024</span><span class="token punctuation">;</span>&#x751F;&#x6210;&#x65B9;&#x5F0F;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;open<span class="token operator">-</span>ssh&#x6216;&#x8005;&#x4F7F;&#x7528;&#x5DE5;&#x5177;&#x7C7B;com<span class="token punctuation">.</span>mpush<span class="token punctuation">.</span>tools<span class="token punctuation">.</span>crypto<span class="token punctuation">.</span>RSAUtils#main
        <span class="token keyword">private</span><span class="token operator">-</span>key<span class="token operator">=</span><span class="token string">&quot;MIIBNgIBADANBgkqhkiG9w0BAQEFAASCASAwggEcAgEAAoGBAKCE8JYKhsbydMPbiO7BJVq1pbuJWJHFxOR7L8Hv3ZVkSG4eNC8DdwAmDHYu/wadfw0ihKFm2gKDcLHp5yz5UQ8PZ8FyDYvgkrvGV0ak4nc40QDJWws621dm01e/INlGKOIStAAsxOityCLv0zm5Vf3+My/YaBvZcB5mGUsPbx8fAgEAAoGAAy0+WanRqwRHXUzt89OsupPXuNNqBlCEqgTqGAt4Nimq6Ur9u2R1KXKXUotxjp71Ubw6JbuUWvJg+5Rmd9RjT0HOUEQF3rvzEepKtaraPhV5ejEIrB+nJWNfGye4yzLdfEXJBGUQzrG+wNe13izfRNXI4dN/6Q5npzqaqv0E1CkCAQACAQACAQACAQACAQA=&quot;</span>
        <span class="token keyword">public</span><span class="token operator">-</span>key<span class="token operator">=</span><span class="token string">&quot;MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCghPCWCobG8nTD24juwSVataW7iViRxcTkey/B792VZEhuHjQvA3cAJgx2Lv8GnX8NIoShZtoCg3Cx6ecs+VEPD2fBcg2L4JK7xldGpOJ3ONEAyVsLOttXZtNXvyDZRijiErQALMTorcgi79M5uVX9/jMv2Ggb2XAeZhlLD28fHwIDAQAB&quot;</span>
        aes<span class="token operator">-</span>key<span class="token operator">-</span>length<span class="token operator">=</span><span class="token number">16</span> <span class="token comment" spellcheck="true">//AES key &#x957F;&#x5EA6;</span>
        ras<span class="token operator">-</span>key<span class="token operator">-</span>length<span class="token operator">=</span><span class="token number">1024</span> <span class="token comment" spellcheck="true">//RSA key &#x957F;&#x5EA6;</span>
    <span class="token punctuation">}</span>

    #&#x7F51;&#x7EDC;&#x914D;&#x7F6E;
    net <span class="token punctuation">{</span>
        connect<span class="token operator">-</span>server<span class="token operator">-</span>port<span class="token operator">=</span><span class="token number">3000</span> <span class="token comment" spellcheck="true">//&#x957F;&#x94FE;&#x63A5;&#x670D;&#x52A1;&#x5BF9;&#x5916;&#x7AEF;&#x53E3;, &#x516C;&#x7F51;&#x7AEF;&#x53E3;</span>
        gateway<span class="token operator">-</span>server<span class="token operator">-</span>port<span class="token operator">=</span><span class="token number">3001</span> <span class="token comment" spellcheck="true">//&#x7F51;&#x5173;&#x670D;&#x52A1;&#x7AEF;&#x53E3;, &#x5185;&#x90E8;&#x7AEF;&#x53E3;</span>
        admin<span class="token operator">-</span>server<span class="token operator">-</span>port<span class="token operator">=</span><span class="token number">3002</span> <span class="token comment" spellcheck="true">//&#x63A7;&#x5236;&#x53F0;&#x670D;&#x52A1;&#x7AEF;&#x53E3;, &#x5185;&#x90E8;&#x7AEF;&#x53E3;</span>
        <span class="token keyword">public</span><span class="token operator">-</span>host<span class="token operator">-</span>mapping <span class="token punctuation">{</span> <span class="token comment" spellcheck="true">//&#x672C;&#x673A;&#x5C40;&#x57DF;&#x7F51;IP&#x548C;&#x516C;&#x7F51;IP&#x7684;&#x6620;&#x5C04;&#x5173;&#x7CFB;</span>
            <span class="token string">&quot;127.0.0.1&quot;</span><span class="token operator">:</span><span class="token string">&quot;111.1.32.137&quot;</span>
        <span class="token punctuation">}</span>
        traffic<span class="token operator">-</span>shaping <span class="token punctuation">{</span> <span class="token comment" spellcheck="true">//&#x6D41;&#x91CF;&#x6574;&#x5F62;&#x914D;&#x7F6E;</span>
            gateway<span class="token operator">-</span>client <span class="token punctuation">{</span>
                enabled<span class="token operator">:</span><span class="token boolean">true</span>
                check<span class="token operator">-</span>interval<span class="token operator">:</span>100ms
                write<span class="token operator">-</span>global<span class="token operator">-</span>limit<span class="token operator">:</span>1k
                read<span class="token operator">-</span>global<span class="token operator">-</span>limit<span class="token operator">:</span><span class="token number">0</span>
                write<span class="token operator">-</span>channel<span class="token operator">-</span>limit<span class="token operator">:</span>256b
                read<span class="token operator">-</span>channel<span class="token operator">-</span>limit<span class="token operator">:</span><span class="token number">0</span>
            <span class="token punctuation">}</span>

            gateway<span class="token operator">-</span>server <span class="token punctuation">{</span>
                enabled<span class="token operator">:</span><span class="token boolean">true</span>
                check<span class="token operator">-</span>interval<span class="token operator">:</span>100ms
                write<span class="token operator">-</span>global<span class="token operator">-</span>limit<span class="token operator">:</span><span class="token number">0</span>
                read<span class="token operator">-</span>global<span class="token operator">-</span>limit<span class="token operator">:</span>10k
                write<span class="token operator">-</span>channel<span class="token operator">-</span>limit<span class="token operator">:</span><span class="token number">0</span>
                read<span class="token operator">-</span>channel<span class="token operator">-</span>limit<span class="token operator">:</span><span class="token number">0</span><span class="token punctuation">.</span>5k
            <span class="token punctuation">}</span>

            connect<span class="token operator">-</span>server <span class="token punctuation">{</span>
                enabled<span class="token operator">:</span><span class="token boolean">false</span>
                check<span class="token operator">-</span>interval<span class="token operator">:</span>100ms
                write<span class="token operator">-</span>global<span class="token operator">-</span>limit<span class="token operator">:</span><span class="token number">0</span>
                read<span class="token operator">-</span>global<span class="token operator">-</span>limit<span class="token operator">:</span>100k
                write<span class="token operator">-</span>channel<span class="token operator">-</span>limit<span class="token operator">:</span>3k
                read<span class="token operator">-</span>channel<span class="token operator">-</span>limit<span class="token operator">:</span>3k
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>

    #Zookeeper&#x914D;&#x7F6E;
    zk <span class="token punctuation">{</span>
        server<span class="token operator">-</span>address<span class="token operator">=</span><span class="token string">&quot;127.0.0.1:2181&quot;</span>
        namespace<span class="token operator">=</span>mpush
        digest<span class="token operator">=</span>mpush
        local<span class="token operator">-</span>cache<span class="token operator">-</span>path<span class="token operator">=</span><span class="token operator">/</span>
        retry <span class="token punctuation">{</span>
            #initial amount of time to wait between retries
            baseSleepTimeMs<span class="token operator">=</span>3s
            #max number of times to retry
            maxRetries<span class="token operator">=</span><span class="token number">3</span>
            #max time in ms to sleep on each retry
            maxSleepMs<span class="token operator">=</span>5s
        <span class="token punctuation">}</span>
        connectionTimeoutMs<span class="token operator">=</span>5s
        sessionTimeoutMs<span class="token operator">=</span>5s
    <span class="token punctuation">}</span>

    #Redis&#x96C6;&#x7FA4;&#x914D;&#x7F6E;
    redis <span class="token punctuation">{</span>
        write<span class="token operator">-</span>to<span class="token operator">-</span>zk<span class="token operator">=</span><span class="token boolean">true</span><span class="token comment" spellcheck="true">//&#x662F;&#x5426;&#x6BCF;&#x6B21;&#x542F;&#x52A8;&#x670D;&#x52A1;&#x90FD;&#x628A;redis&#x96C6;&#x7FA4;&#x914D;&#x7F6E;&#x5199;&#x5230;redis</span>
        #redis &#x96C6;&#x7FA4;&#x914D;&#x7F6E;&#xFF0C;group &#x662F;&#x4E2A;&#x4E8C;&#x7EF4;&#x6570;&#x7EC4;&#xFF0C;&#x7B2C;&#x4E00;&#x5C42;&#x8868;&#x793A;&#x6709;&#x591A;&#x5C11;&#x7EC4;&#x96C6;&#x7FA4;&#xFF0C;&#x6BCF;&#x4E2A;&#x96C6;&#x7FA4;&#x4E0B;&#x9762;&#x53EF;&#x4EE5;&#x6709;&#x591A;&#x53F0;&#x673A;&#x5668;
        cluster<span class="token operator">-</span>group<span class="token operator">:</span><span class="token punctuation">[</span>
            <span class="token punctuation">[</span>
                <span class="token punctuation">{</span>
                    host<span class="token operator">:</span><span class="token string">&quot;127.0.0.1&quot;</span>
                    port<span class="token operator">:</span><span class="token number">2181</span>
                    password<span class="token operator">:</span>ShineMoIpo
                <span class="token punctuation">}</span>
            <span class="token punctuation">]</span>
        <span class="token punctuation">]</span>
        config <span class="token punctuation">{</span><span class="token comment" spellcheck="true">//&#x6807;&#x6CE8;Jedis config &#x914D;&#x7F6E;</span>
            maxTotal<span class="token operator">:</span><span class="token number">8</span><span class="token punctuation">,</span>
            maxIdle<span class="token operator">:</span><span class="token number">4</span><span class="token punctuation">,</span>
            minIdle<span class="token operator">:</span><span class="token number">1</span><span class="token punctuation">,</span>
            lifo<span class="token operator">:</span><span class="token boolean">true</span><span class="token punctuation">,</span>
            fairness<span class="token operator">:</span><span class="token boolean">false</span><span class="token punctuation">,</span>
            maxWaitMillis<span class="token operator">:</span><span class="token number">5000</span><span class="token punctuation">,</span>
            minEvictableIdleTimeMillis<span class="token operator">:</span><span class="token number">300000</span><span class="token punctuation">,</span>
            softMinEvictableIdleTimeMillis<span class="token operator">:</span><span class="token number">1800000</span><span class="token punctuation">,</span>
            numTestsPerEvictionRun<span class="token operator">:</span><span class="token number">3</span><span class="token punctuation">,</span>
            testOnCreate<span class="token operator">:</span><span class="token boolean">false</span><span class="token punctuation">,</span>
            testOnBorrow<span class="token operator">:</span><span class="token boolean">false</span><span class="token punctuation">,</span>
            testOnReturn<span class="token operator">:</span><span class="token boolean">false</span><span class="token punctuation">,</span>
            testWhileIdle<span class="token operator">:</span><span class="token boolean">false</span><span class="token punctuation">,</span>
            timeBetweenEvictionRunsMillis<span class="token operator">:</span><span class="token number">60000</span><span class="token punctuation">,</span>
            blockWhenExhausted<span class="token operator">:</span><span class="token boolean">true</span><span class="token punctuation">,</span>
            jmxEnabled<span class="token operator">:</span><span class="token boolean">true</span><span class="token punctuation">,</span>
            jmxNamePrefix<span class="token operator">:</span>pool<span class="token punctuation">,</span>
            jmxNameBase<span class="token operator">:</span>pool
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>

    #HTTP&#x4EE3;&#x7406;&#x914D;&#x7F6E;
    http <span class="token punctuation">{</span>
        proxy<span class="token operator">-</span>enabled<span class="token operator">=</span><span class="token boolean">false</span> <span class="token comment" spellcheck="true">//&#x542F;&#x7528;Http&#x4EE3;&#x7406;</span>
        max<span class="token operator">-</span>conn<span class="token operator">-</span>per<span class="token operator">-</span>host<span class="token operator">=</span><span class="token number">5</span> <span class="token comment" spellcheck="true">//&#x6BCF;&#x4E2A;&#x57DF;&#x540D;&#x7684;&#x6700;&#x5927;&#x94FE;&#x63A5;&#x6570;, &#x5EFA;&#x8BAE;web&#x670D;&#x52A1;nginx&#x8D85;&#x65F6;&#x65F6;&#x95F4;&#x8BBE;&#x957F;&#x4E00;&#x70B9;, &#x4EE5;&#x4FBF;&#x4FDD;&#x6301;&#x957F;&#x94FE;&#x63A5;</span>
        <span class="token keyword">default</span><span class="token operator">-</span>read<span class="token operator">-</span>timeout<span class="token operator">=</span>10s <span class="token comment" spellcheck="true">//&#x8BF7;&#x6C42;&#x8D85;&#x65F6;&#x65F6;&#x95F4;</span>
        max<span class="token operator">-</span>content<span class="token operator">-</span>length<span class="token operator">=</span>5m <span class="token comment" spellcheck="true">//response body &#x6700;&#x5927;&#x5927;&#x5C0F;</span>
        dns<span class="token operator">-</span>mapping <span class="token punctuation">{</span> <span class="token comment" spellcheck="true">//&#x57DF;&#x540D;&#x6620;&#x5C04;&#x5916;&#x7F51;&#x5730;&#x5740;&#x8F6C;&#x5185;&#x90E8;IP</span>
            <span class="token string">&quot;mpush.com&quot;</span><span class="token operator">:</span><span class="token punctuation">[</span><span class="token string">&quot;127.0.0.1:8080&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;127.0.0.1:8081&quot;</span><span class="token punctuation">]</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>

    #&#x7EBF;&#x7A0B;&#x6C60;&#x914D;&#x7F6E;
    thread <span class="token punctuation">{</span>
        pool <span class="token punctuation">{</span>
            boss <span class="token punctuation">{</span> <span class="token comment" spellcheck="true">//netty boss</span>
                min<span class="token operator">:</span><span class="token number">4</span>
                max<span class="token operator">:</span><span class="token number">16</span>
                queue<span class="token operator">-</span>size<span class="token operator">:</span><span class="token number">1000</span>
            <span class="token punctuation">}</span>

            work <span class="token punctuation">{</span> <span class="token comment" spellcheck="true">//netty work</span>
                min<span class="token operator">:</span><span class="token number">8</span>
                max<span class="token operator">:</span><span class="token number">32</span>
                queue<span class="token operator">-</span>size<span class="token operator">:</span><span class="token number">1000</span>
            <span class="token punctuation">}</span>

            event<span class="token operator">-</span>bus <span class="token punctuation">{</span><span class="token comment" spellcheck="true">//&#x5185;&#x90E8;&#x5F02;&#x6B65;&#x4E8B;&#x4EF6;</span>
                min<span class="token operator">:</span><span class="token number">4</span>
                max<span class="token operator">:</span><span class="token number">4</span>
                queue<span class="token operator">-</span>size<span class="token operator">:</span><span class="token number">10000</span> <span class="token comment" spellcheck="true">//&#x5927;&#x91CF;&#x7684;online&#xFF0C;offline&#xFF0C;</span>
            <span class="token punctuation">}</span>

            http<span class="token operator">-</span>proxy <span class="token punctuation">{</span>
                min<span class="token operator">:</span><span class="token number">8</span>
                max<span class="token operator">:</span><span class="token number">64</span>
                queue<span class="token operator">-</span>size<span class="token operator">:</span><span class="token number">1000</span>
            <span class="token punctuation">}</span>

            biz <span class="token punctuation">{</span> <span class="token comment" spellcheck="true">//&#x5176;&#x4ED6;&#x4E1A;&#x52A1;</span>
                min<span class="token operator">:</span><span class="token number">4</span>
                max<span class="token operator">:</span><span class="token number">64</span>
                queue<span class="token operator">-</span>size<span class="token operator">:</span><span class="token number">10</span>
            <span class="token punctuation">}</span>

            mq <span class="token punctuation">{</span> <span class="token comment" spellcheck="true">//&#x7528;&#x6237;&#x4E0A;&#x4E0B;&#x7EBF;&#x6D88;&#x606F;, &#x8E22;&#x4EBA;&#x7B49;</span>
                min<span class="token operator">:</span><span class="token number">2</span>
                max<span class="token operator">:</span><span class="token number">4</span>
                queue<span class="token operator">-</span>size<span class="token operator">:</span><span class="token number">10000</span>
            <span class="token punctuation">}</span>

            push<span class="token operator">-</span>callback <span class="token punctuation">{</span> <span class="token comment" spellcheck="true">//&#x6D88;&#x606F;&#x63A8;&#x9001;</span>
                min<span class="token operator">:</span><span class="token number">2</span>
                max<span class="token operator">:</span><span class="token number">2</span>
                queue<span class="token operator">-</span>size<span class="token operator">:</span><span class="token number">0</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>

    #&#x7CFB;&#x7EDF;&#x76D1;&#x63A7;&#x914D;&#x7F6E;
    monitor <span class="token punctuation">{</span>
        dump<span class="token operator">-</span>dir<span class="token operator">=</span><span class="token operator">/</span>tmp<span class="token operator">/</span>logs<span class="token operator">/</span>mpush<span class="token operator">/</span>
        dump<span class="token operator">-</span>stack<span class="token operator">=</span><span class="token boolean">false</span> <span class="token comment" spellcheck="true">//&#x662F;&#x5426;&#x5B9A;&#x65F6;dump&#x5806;&#x6808;</span>
        dump<span class="token operator">-</span>period<span class="token operator">=</span>1m  <span class="token comment" spellcheck="true">//&#x591A;&#x4E45;&#x76D1;&#x63A7;&#x4E00;&#x6B21;</span>
        print<span class="token operator">-</span>log<span class="token operator">=</span><span class="token boolean">true</span> <span class="token comment" spellcheck="true">//&#x662F;&#x5426;&#x6253;&#x5370;&#x76D1;&#x63A7;&#x65E5;&#x5FD7;</span>
    <span class="token punctuation">}</span>

    #SPI&#x6269;&#x5C55;&#x914D;&#x7F6E;
    spi <span class="token punctuation">{</span>
        thread<span class="token operator">-</span>pool<span class="token operator">-</span>factory<span class="token operator">:</span><span class="token string">&quot;com.mpush.tools.thread.pool.DefaultThreadPoolFactory&quot;</span>
        dns<span class="token operator">-</span>mapping<span class="token operator">-</span>manager<span class="token operator">:</span><span class="token string">&quot;com.mpush.common.net.HttpProxyDnsMappingManager&quot;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span></code></pre>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; ohun.com 2016 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2016-08-28 08:57:29
</span></footer>


                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="chapter13.html" class="navigation navigation-prev " aria-label="Previous page: 6.源码测试">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="chapter17.html" class="navigation navigation-next " aria-label="Next page: 8.Alloc实现">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"7.配置详解","level":"1.8","depth":1,"next":{"title":"8.Alloc实现","level":"1.9","depth":1,"path":"chapter17.md","ref":"chapter17.md","articles":[]},"previous":{"title":"6.源码测试","level":"1.7","depth":1,"path":"chapter13.md","ref":"chapter13.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","sharing","search","-highlight","-page-treeview","-anchorjs","baidu","donate","tbfed-pagefooter","navigator","duoshuo","editlink","splitter"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy ohun.com 2016","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{},"editlink":{"label":"编辑本页","multilingual":false,"base":"https://github.com/mpusher/docs/tree/book"},"splitter":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"duoshuo":{"short_name":"mpush","theme":"default"},"donate":{"alipay":"alipay.jpg","alipayText":"支付宝打赏","button":"赏","title":"","wechat":"wxpay.png","wechatText":"微信打赏"},"fontsettings":{"theme":"sepia","family":"sans","size":2},"navigator":{},"baidu":{"token":"74e8d02bb383b3d88072165c31989fb2"},"sharing":{"all":["facebook","google","twitter","weibo","instapaper"],"facebook":true,"google":false,"instapaper":false,"twitter":true,"vk":false,"weibo":false},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchorjs":{"icon":"#","placement":"right","visible":"always","class":"custom-class another-one"}},"theme":"default","author":"夜色","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"MPUSH开发文档","language":"zh-hans","gitbook":"*","description":"mpush开发手册"},"file":{"path":"chapter14.md","mtime":"2016-08-28T00:57:29.000Z","type":"markdown"},"gitbook":{"version":"3.2.0","time":"2016-10-26T16:14:58.733Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-baidu/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-duoshuo/duoshuo.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-editlink/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

